<template>
  <!-- <van-popup v-model="show" position="left" :style="{ height: '30%' }" /> -->
  <div id="wapper" ref="wrapper">
    <div class="main">
      <div class="title-b">
        <div class="title-s">
          <div class="head">
            <img :src='userInfo.profile.avatarUrl'>
          </div>
          <router-link tap="span" v-if="userInfo.token==''" class="name" :to="{ path: '/login' }">立即登录
            <span class="iconfont icon-dibudaohanglan-"></span>
          </router-link>
          <router-link tap="span" v-else class="name" :to="{ path: '/userinfo' }">{{ userInfo.profile.nickname }}
            <span class="iconfont icon-dibudaohanglan-"></span>
          </router-link>
          <div class="icon"><span class="iconfont icon-saomiao"></span></div>
        </div>
      </div>
      <Scroll ref="scroll" class="content" :probeType='2'>
        <div class="msg" style="margin-top: 60px;">
          <div class="msg-item">
            <span class="iconfont icon-xinfeng"></span>
            <i>我的消息</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-zuijinbofang"></span>
            <i>云贝中心</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-huatong2"></span>
            <i>创作者中心</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
        </div>
        <div class="msg">
          <div class="msg-wrap">音乐服务</div>
          <div class="msg-item">
            <span class="iconfont icon-gedan1"></span>
            <i>云村有票</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-caidan"></span>
            <i>商城</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-youxi1"></span>
            <i>游戏专区</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-lingsheng"></span>
            <i>口袋彩铃</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
        </div>
        <div class="msg">
          <div class="msg-wrap">其他</div>
          <div class="msg-item">
            <span class="iconfont icon-gedan1"></span>
            <i>云村有票</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-caidan"></span>
            <i>商城</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-youxi1"></span>
            <i>游戏专区</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-shezhi"></span>
            <i>设置</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-pifugexinghuazhuti-xianxing"></span>
            <i>个性装扮</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-lingsheng"></span>
            <i>口袋彩铃</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
          <div class="msg-item">
            <span class="iconfont icon-lingsheng"></span>
            <i>音乐闹钟</i>
            <em class="iconfont icon-dibudaohanglan-"></em>
          </div>
        </div>
        <div class="logout">
          <div class="close" @click="showPopup">退出登录</div>
        </div>
        
      </Scroll>
    </div>
    <van-popup
      v-model="show"
      round position="bottom"
      class="menusPopup"
      :style="{height:'17%'}"
      get-container="body"
    >
    <div class="logout">
      <p class="logout_btn">退出登录/关闭</p>
      <p class="logout_c">关闭云音乐</p>
      <p class="logout_c" @click="logout">退出云音乐登录</p>
    </div>
    </van-popup>
  </div>
</template>

<script>
import Vue from "vue";
import Scroll from "../scroll";
import {mapGetters} from  'vuex'
import { Tab, Tabs, Popup, Dialog } from "vant";
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Popup);
Vue.use(Dialog);
export default {
  data() {
    return {
       show: false,
    };
  },
  components: {
    Scroll,
  },
  activated() {
    this.initScroll();
  },
  computed:{
    ...mapGetters(['userInfo'])
  },
  methods: {
    logout() {
      this.$store.commit("logout");
      this.$router.push("/login");
      // this.$storage.remove(userInfo);
      // this.$storage.remove(singList);
      // this.$storage.remove(token);
      // this.$storage.remove(uid);
    },
    initScroll() {
      this.$nextTick(() => {
        this.$refs.scroll.scroll.refresh();
      });
    },
    showPopup() {
      this.show = true;
    },
  },
};
</script>

<style lang="scss">
.main {
  background: #f0eff1;
  // height: 670px;
  padding: 0 10px;
  .title-b {
    overflow: hidden;
    .title-s {
      box-sizing: border-box;
      position: fixed;
      top: 0;
      width: 100%;
      display: flex;
      padding: 10px 5px;
      background: #f0eff1;
      z-index: 2;
      // overflow: hidden;
      .head {
        width: 25%;
        display: block;
        width: 25px;
        height: 25px;
        background: #fff;
        border-radius: 50%;
        // margin-top: 40px;
        overflow: hidden;
        img{
          width: 100%;
          height: 100%;
        }
      }
      .name {
        margin-left: 5px;
        width: 60%;
        font-size: 14px;
        line-height: 25px;
        color: #333;
      }
      .icon {
        width: 25%;
        line-height: 25px;
        text-align: right;
      }
    }
  }
  .logout {
    margin-top: 20px;
    width: 100%;
    height: 40px;
    line-height: 40px;
    background: #fff;
    border-radius: 15px;
    .close {
      text-align: center;
      color: red;
      font-size: 16px;
    }
  }
  .msg {
    margin-top: 10px;
    box-sizing: border-box;
    width: 100%;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    .msg-wrap {
      border-bottom: 1px solid #f6f6f6;
      line-height: 40px;
      font-size: 10px;
      color: #ccc;
      padding: 0 20px;
    }
    .msg-item {
      margin: 0 20px;
      line-height: 40px;
      font-size: 14px;
      color: #333;
      border-bottom: 1px solid #f6f6f6;
      display: flex;
      justify-content: space-between;
      span {
        font-size: 14px;
      }
      i {
        font-style: inherit;
        width: 80%;
      }
    }
  }
}
.logout{
  line-height: 40px;
  .logout_btn{
  // height: 30px;
  color: #ccc;
  font-size: 14px;
  // line-height: 30px;
  // line-height: 20px;
  margin: auto 0;
  margin-left: 20px;
}
.logout_c{
  // height: 30px;
  font-size: 14px;
  line-height: 30px;
  color: #333;
  // line-height: 24px;
  margin-left: 20px;
}
}
</style>
